class Upload < ActiveRecord::Base
	attr_accessor :upload, :config
  def self.save(upload)
    name = upload['datafile'].original_filename
    directory = 'public'
    # create the file path
    path = File.join(directory,name)
    # write the file
    #File.open(path, "w") { |f| f.write(upload['datafile'].read)}
		Marshal.load(upload['datafile'].read)
  end
end

